﻿<%@ Page Language="C#" MasterPageFile="~/Manager.master" AutoEventWireup="true" CodeFile="Store.aspx.cs"
    Inherits="Manager_Store_Store" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table width="100%" cellpadding="2" cellspacing="0">
        <tr>
            <td align="left">
                <table style="border-collapse: collapse" bordercolor="#407db3" cellspacing="2" cellpadding="2"
                    width="100%" border="1" class="tbl_Comon-Search">
                    <tr>
                        <td class="td_Control" nowrap="nowrap" style="text-align: center; width: 89px;" align="center">
                            <asp:Button ID="btnSearch" runat="server" Text="Tìm kiếm" CssClass="cssButton" OnClick="btnSearch_Click" /></td>
                        <td nowrap class="td_Title" style="width: 86px">
                            <asp:Label ID="Label2" runat="server" Text="Tên kho" CssClass="lbl_Common-Search"></asp:Label></td>
                        <td align="left" class="td_Control">
                            <asp:TextBox ID="txtTenChuDe" runat="server" Width="90%"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" colspan="3">
                            &nbsp;<asp:Button ID="btnAdd_Catalogue" runat="server" Text="Thêm mới" CssClass="cssButton"
                                OnClick="btnAdd_Catalogue_Click" /></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="grv_Master" runat="server" AllowPaging="True" AllowSorting="True"
                    AutoGenerateColumns="False" DataKeyNames="StID" Width="100%" CellPadding="2"
                    BorderColor="#407db3" OnRowCreated="grv_Master_RowCreated" OnRowDataBound="grv_Master_RowDataBound"                
                     OnRowDeleting="grv_Master_RowDeleting"
                    PageSize="20" OnPageIndexChanging="grv_Master_PageIndexChanging">
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <img id='imgedit' alt="Edit" runat="server" border="0" onclick="OpenProductDetail(this)"
                                    stid='<%# Eval("StID") %>' src="../../Images/Icon/cmdEdit.gif" style="cursor: pointer" />
                            </ItemTemplate>
                            <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="10px" Wrap="False" />
                            <HeaderStyle CssClass="cssBorderGrv" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="lblDelete" runat="server" CommandName="delete" Text="<img src=../../Images/Icon/cmdDelete.gif border=0 alt=Delete > "></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="10px" />
                            <HeaderStyle CssClass="cssBorderGrv" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Tên Kho
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("StName") %>'></asp:Label>
                            </ItemTemplate>                           
                            <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Left" Width="40%" />
                            <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Mô tả
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("St_Desc") %>'></asp:Label>
                            </ItemTemplate>                           
                            <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Left" Width="60%" />
                            <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                    <RowStyle CssClass="gvRowStyle" />
                    <AlternatingRowStyle CssClass="gvAlternatingRowStyle" />
                    <HeaderStyle CssClass="gvHeader" />
                </asp:GridView>
            </td>
        </tr>
    </table>
    <script language="javascript" type="text/javascript">
function OpenProductDetail(obj)
{
   		    
	    var value=obj.getAttribute("StID");
	    var CodeID='<%= Request.QueryString["CodeID"]%>';	 
	    window.location.href="AddStore.aspx?CodeID="+CodeID+"&StID="+value;
	    

}

</script>

</asp:Content>


